06. CODE: The RouteModel Class

The RouteModel Class

L4 The RouteModel Class

The Model class that exists in the current code doesn't contain all the data or methods that will be needed to perform an A* search, so we are going to extend that class with a RouteModel class. In this exercise, you will fill out the RouteModel class in route_model.h. In the next exercises, you will also fill out the RouteModel::Node class as well.

## To complete this exercise:

In route_model.h:

  1. Add a private vector of Node objects named m_Nodes. This will store all of the nodes from the Open Street Map data.
  2. Add a public "getter" method SNodes. This method should return a reference to the vector of Nodes stored as m_Nodes.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: react
  • Opened files (when workspace is loaded): n/a
  • userCode:

    export CXX=g++-7
    export CXXFLAGS=-std=c++17
    cmake_tests() {
    /usr/local/bin/cmake -DTESTING="RouteModel" "$1"
    }
    export -f cmake_tests

Solution

Try to look at the solution below only if you are really stuck!

The RouteModel Class